# 查找的数据集
l = [i for i in range(100)]
# 查找的目标值
target = 0


def binary_search(l, target, start_index, end_index):
    if start_index > end_index:
        return '未找到'
    mid_index = (start_index + end_index) // 2
    if target == l[mid_index]:
        return '找到了'
    elif target > l[mid_index]:
        start_index = mid_index + 1
    else:
        end_index = mid_index - 1
    return binary_search(l, target, start_index, end_index)


res = binary_search(l, target, 0, len(l) - 1)
print(res)
